< previous page page_416 next page >

Page 416
0416-01.jpg
Figure 11.5.
Creating a graph using Visual Basic code.
warning.gif
If you are using Visual Basic 5's new ''code-complete" option, notice that the editor suggests the properties "gphOff" or "gphOn" as valid values for the AutoInc property. In our version of Visual Basic 5, these values returned an error. Be sure to enter a value of 1 for the AutoInc property of the GRAPH32.OCX control.

Type.gifListing 11.2. Adding code to the CmdAutoSales_Click event.
Private Sub cmdAutoSales_Click()
    '
    ' add data using VB code
    '
    Dim intLoop As Integer
    '
    Graph1.DataReset = gphAllData   ' clear out all properties
    Graph1.GraphType = gphBar3D     ' use 3d bar chart
    '
    Graph1.NumSets = 1  ' only one set of data
    Graph1.NumPoints = 12 ' one for each month
    '
    ' now add the data
    '

 
< previous page page_416 next page >

If you like this book, buy it!